<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="__PUBLIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/font-awesome.min.css" />
<!--[if IE 7]>
		  <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->
<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace.min.css" />
<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-rtl.min.css" />
<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-skins.min.css" />
<link rel="stylesheet" href="__PUBLIC__/admin/css/style.css" />
<!--[if lte IE 8]>
		  <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-ie.min.css" />
		<![endif]-->
<script src="__PUBLIC__/admin/assets/js/ace-extra.min.js"></script>
<!--[if lt IE 9]>
		<script src="__PUBLIC__/admin/assets/js/html5shiv.js"></script>
		<script src="__PUBLIC__/admin/assets/js/respond.min.js"></script>
		<![endif]-->
<script src="__PUBLIC__/admin/js/jquery-1.9.1.min.js"></script>
<script src="__PUBLIC__/admin/assets/layer/layer.js" type="text/javascript"></script>
<title>登陆</title>
</head>

<body class="login-layout">
	<div class="logintop">
		<span>欢迎后台管理界面平台</span>
		<ul>
			<li><a href="__PUBLIC__/admin/#">返回首页</a></li>
			<li><a href="__PUBLIC__/admin/#">帮助</a></li>
			<li><a href="__PUBLIC__/admin/#">关于</a></li>
		</ul>
	</div>
	<div class="loginbody">
		<div class="login-container">
			<div class="center">
				<h1>
					<i class="icon-leaf green"></i> <span class="orange">车钉钉</span> <span
						class="white">后台管理系统</span>
				</h1>
				<h4 class="white">Background Management System</h4>
			</div>

			<div class="space-6"></div>

			<div class="position-relative">
				<div id="login-box" class="login-box widget-box no-border visible">
					<div class="widget-body">
						<div class="widget-main">
							<h4 class="header blue lighter bigger">
								<i class="icon-coffee green"></i> 管理员登陆
							</h4>

							<div class="login_icon">
								<img width=130 src="__PUBLIC__/admin/images/login.png" />
							</div>

							<form class="">
								<fieldset>
									<label class="block clearfix"> <span
										class="block input-icon input-icon-right"> <input
											type="text" class="form-control" placeholder="登录名" name="name" iname="用户名" value="{:empty($Think.cookie.aname)?$Think.cookie.aname:''}">
												<i class="icon-user"></i></span>
									</label> <label class="block clearfix"> <span
										class="block input-icon input-icon-right"> <input
											type="password" class="form-control" placeholder="密码" iname="密码" value="{:empty($Think.cookie.apwd)?$Think.cookie.apwd:''}"
											name="pwd"> <i class="icon-lock"></i></span>
									</label>

									<div class="space"></div>

									<div class="clearfix">
										<label class="inline"> <input type="checkbox" name='save'
											class="ace"> <span class="lbl">保存密码</span></label>

										<button type="button"
											class="width-35 pull-right btn btn-sm btn-primary"
											id="login_btn">
											<i class="icon-key"></i> 登陆
										</button>
									</div>

									<div class="space-4"></div>
								</fieldset>
							</form>

							<div class="social-or-login center">
								<span class="bigger-110">通知</span>
							</div>

							<div class="social-login center">暂无通知</div>
						</div>
						<!-- /widget-main -->

						<div class="toolbar clearfix"></div>
					</div>
					<!-- /widget-body -->
				</div>
				<!-- /login-box -->
			</div>
			<!-- /position-relative -->
		</div>
	</div>
	<div class="loginbm">
		版权所有 2017 <a href="__PUBLIC__/admin/">YagamiZN</a>
	</div>
	<strong></strong>
</body>
</html>
<script >
$('#login_btn').on('click', function(){
	   var num=0;
		 var str="";
     $("input[type$='text']").each(function(n){
          if($(this).val()=="")
          {
			   layer.msg(str+=""+$(this).attr("iname")+"不能为空！\r\n",{
				icon:0,								
          }); 
		    num++;
            return false;            
          } 
		 });
		  if(num>0){  return false;}	 	
          else{
			   var name=$("[name=name]").val();
			   var pwd=$("[name=pwd]").val();
			   var save=$("[name=save]").prop('checked');
			   $.ajax({
			   	type:"get",
			   	url:"{:url('Login/loginCheck')}",
			   	data:{name:name,pwd,pwd,save:save},
			   	success:function(jsonData){
			   		if(jsonData.code==200){
			   			layer.msg('登陆成功！',{
			   				icon:1,	
			      });
			        location.href="{:url('Index/index')}";
			   		}else if(jsonData.code==300){
			   			  layer.msg(jsonData.msg,{
								icon:2,								
          }); 
			   		}
			   	}
			   });
		  }		  		     						
		
	})
</script>